import com.su.pojo.Book;
import com.su.service.BookService;
import com.su.service.BookServiceImpl;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class Mytest {

    @Test
    public void test1()
    {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        BookService bookService = context.getBean("BookServiceImpl", BookServiceImpl.class);
        Book book = bookService.getBookById(1);
        System.out.println(book);
    }
}
